/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ar.lucas.controlgasto.utils;

import java.text.DateFormatSymbols;
import javax.swing.JOptionPane;

/**
 *
 * @author lucmussi
 */
public class Validations {

    public static String showConceptoInputDialog(){
        String inputValue = JOptionPane.showInputDialog(null, "Ingrese el nuevo concepto: ", "Nuevo Concepto", JOptionPane.OK_CANCEL_OPTION);
        if(inputValue != null){
            if(inputValue.equals("") || !inputValue.matches("[A-Za-z]*"))
            {
                JOptionPane.showMessageDialog(null, "Debe Ingresar un nombre válido","Error",JOptionPane.ERROR_MESSAGE);
                inputValue = showConceptoInputDialog();
            }
        }

        return inputValue;
    }

    public static String getMonthForInt(int m) {
        String month = "invalido";
        DateFormatSymbols dfs = new DateFormatSymbols();
        String[] months = dfs.getMonths();
        if (m >= 0 && m <= 11 ) {
            month = months[m];
        }
        return month;
    }

    private static boolean validarGasto(Double monto){
        

        return false;
    }

}
